﻿using System;
using UnityEngine;

// Token: 0x02000204 RID: 516
public class MentalState
{
	// Token: 0x06000AF7 RID: 2807 RVA: 0x0005CE84 File Offset: 0x0005B084
	public MentalState(EntityBase entity)
	{
		this.entity = entity;
		this.normal = 0.5f;
		this.curiosity = Mathf.Pow(UnityEngine.Random.value, 8f);
		this.hostile = Mathf.Pow(UnityEngine.Random.value, 2f);
	}

	// Token: 0x06000AF8 RID: 2808 RVA: 0x0005CED4 File Offset: 0x0005B0D4
	public void Update()
	{
		this.fear = GameController.Instance.sharedKnowledge.CheckDanger(this.entity) * (1f - this.curiosity);
		if (this.fear > UnityEngine.Random.value)
		{
			this.fear = 1f;
		}
		else
		{
			this.fear = 0f;
		}
	}

	// Token: 0x06000AF9 RID: 2809 RVA: 0x0005CF34 File Offset: 0x0005B134
	public EntityBase ChooseTarget()
	{
		EntityBase dangerEntity = GameController.Instance.sharedKnowledge.dangerEntity;
		if (dangerEntity == null)
		{
			return null;
		}
		if (this.entity.transform.IsChildOf(dangerEntity.transform))
		{
			return null;
		}
		return dangerEntity;
	}

	// Token: 0x0400100D RID: 4109
	private EntityBase entity;

	// Token: 0x0400100E RID: 4110
	public float normal;

	// Token: 0x0400100F RID: 4111
	public float fear;

	// Token: 0x04001010 RID: 4112
	public float curiosity;

	// Token: 0x04001011 RID: 4113
	public float hostile;
}
